package com.spring.nio.core.event.model;

import com.google.common.collect.Lists;
import lombok.Data;
import java.nio.channels.SelectionKey;
import java.util.List;

/**
 * @author: YSFY
 * @date: 2021-03-24 14:26
 * @pacage_name: com.spring.nio.core.event.model
 * @class_name: EventModel
 * @description: EventModel
 */

@Data
public class EventModel {

    /**
     * 当前事件模型下所属的selectionKey
     * */
    private SelectionKey selectionKey;

    /**
     * 当前事件对应的socket地址
     * */
    private String remoteAddress;

    /**
     * 当前事件本地地址
     * */
    private String localAddress;

    /**
     * 事件处理类型(CHAT_EVENT_ACCEPTOR | FILE_UPLOAD_EVENT_ACCEPTOR | FILE_DOWNLOAD_EVENT_ACCEPTOR)
     * */
    private EventModelEnum eventModelEnum;

    /**
     * 事件处理结果
     * */
    private String eventResult;

    /**
     * 当前通道完整帧数据集合(解析后)
     * */
    private List<FrameData> fullFrameDataList = Lists.newArrayList();

    /**
     * 读事件产生的原始帧数据
     * */
    private List<FrameData> originList = Lists.newLinkedList();
}
